
#include "stdafx.h"
#include "WicPersistStream.h"

CWicPersistStream::CWicPersistStream()
{
    m_pIWICPersistStream = NULL;
}

CWicPersistStream::~CWicPersistStream()
{
    if(m_pIWICPersistStream)
    {
        m_pIWICPersistStream->Release();
    }
    m_pIWICPersistStream = NULL;
}

CWicPersistStream::CWicPersistStream(CWicPersistStream const & objPersistStream)
{
    m_pIWICPersistStream = objPersistStream.m_pIWICPersistStream;
    m_pIWICPersistStream->AddRef();
}

CWicPersistStream& CWicPersistStream::operator=(CWicPersistStream const & objPersistStream)
{
    if(m_pIWICPersistStream)
    {
        m_pIWICPersistStream->Release();
    }
    m_pIWICPersistStream = objPersistStream.m_pIWICPersistStream;
    m_pIWICPersistStream->AddRef();
    return *this;
}
